//
//  GYMainTab.m
//  GYDemo
//
//  Created by mac on 2018/3/22.
//  Copyright © 2018年 mac. All rights reserved.
//

//
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                  \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
//
//

#import "GYMainTab.h"
#import "Head.h"

@interface GYMainTab ()

@end

@implementation GYMainTab
#pragma mark - getter and setter
-(GYHomeVC *)homeVC
{
    if (!_homeVC) {
        _homeVC = [GYHomeVC new];
        _homeVC.title = @"首页";
        _homeVC.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"首页" image:[[UIImage imageNamed:@"shouye_n"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"shouye_h"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

    }
    return _homeVC;
}
-(GYProductCategoryVC *)categoryVC
{
    if (!_categoryVC) {
        _categoryVC = [GYProductCategoryVC new];
        _categoryVC.title = @"产品分类";
        _categoryVC.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"产品分类" image:[[UIImage imageNamed:@"chanpinfenlei_n"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"chanpinfenlei_h"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }
    return _categoryVC;
}
-(GYCartVC *)cartVC
{
    if (!_cartVC) {
        _cartVC = [GYCartVC new];
        _cartVC.title = @"购物车";
        _cartVC.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"购物车" image:[[UIImage imageNamed:@"gouwuche_n"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"gouwuche_h"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }
    return _cartVC;
}
-(GYMineVC *)mineVC
{
    if (!_mineVC) {
        _mineVC = [GYMineVC new];
        _mineVC.title = @"我的";
        _mineVC.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"我的" image:[[UIImage imageNamed:@"wode_n"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"wode_h"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }
    return _mineVC;
}
#pragma mark - event
#pragma mark - method
-(void)initilization
{
    self.tabBar.tintColor = Main_Color_Red;
    [self.tabBar setBackgroundColor:[UIColor whiteColor]];
    
    HMSNavigationController *nav1 = [[HMSNavigationController alloc]initWithRootViewController:self.homeVC];
    HMSNavigationController *nav3 = [[HMSNavigationController alloc]initWithRootViewController:self.cartVC];
    HMSNavigationController *nav4 = [[HMSNavigationController alloc]initWithRootViewController:self.mineVC];
    NSArray *views = @[nav1,nav3,nav4];
    
    self.viewControllers = views;
}
///设置小红点消息
-(void)setMessage:(NSString *)msg atIndex:(NSInteger)index
{
//    if (index < self.viewControllers.count) {
//        UITabBarItem *item = [self.viewControllers[index] tabBarItem];
//        [item setCustomBadgeValue:msg.integerValue > 0 ? msg : nil withFont:[UIFont systemFontOfSize:13] andFontColor:Main_Color_White andBackgroundColor:Main_Color_Red];
//    }
}
#pragma mark - life
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initilization];
}

-(void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
//    [self setMessage:@"2" atIndex:2];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
#pragma mark - delegate
@end


/*
 11111111111111111111111111111111111111001111111111111111111111111
 11111111111111111111111111111111111100011111111111111111111111111
 11111111111111111111111111111111100001111111111111111111111111111
 11111111111111111111111111111110000111111111111111111111111111111
 11111111111111111111111111111000000111111111111111111111111111111
 11111111111111111111111111100000011110001100000000000000011111111
 11111111111111111100000000000000000000000000000000011111111111111
 11111111111111110111000000000000000000000000000011111111111111111
 11111111111111111111111000000000000000000000000000000000111111111
 11111111111111111110000000000000000000000000000000111111111111111
 11111111111111111100011100000000000000000000000000000111111111111
 11111111111111100000110000000000011000000000000000000011111111111
 11111111111111000000000000000100111100000000000001100000111111111
 11111111110000000000000000001110111110000000000000111000011111111
 11111111000000000000000000011111111100000000000000011110001111111
 11111110000000011111111111111111111100000000000000001111100111111
 11111111000001111111111111111111110000000000000000001111111111111
 11111111110111111111111111111100000000000000000000000111111111111
 11111111111111110000000000000000000000000000000000000111111111111
 11111111111111111100000000000000000000000000001100000111111111111
 11111111111111000000000000000000000000000000111100000111111111111
 11111111111000000000000000000000000000000001111110000111111111111
 11111111100000000000000000000000000000001111111110000111111111111
 11111110000000000000000000000000000000111111111110000111111111111
 11111100000000000000000001110000001111111111111110001111111111111
 11111000000000000000011111111111111111111111111110011111111111111
 11110000000000000001111111111111111100111111111111111111111111111
 11100000000000000011111111111111111111100001111111111111111111111
 11100000000001000111111111111111111111111000001111111111111111111
 11000000000001100111111111111111111111111110000000111111111111111
 11000000000000111011111111111100011111000011100000001111111111111
 11000000000000011111111111111111000111110000000000000011111111111
 11000000000000000011111111111111000000000000000000000000111111111
 11001000000000000000001111111110000000000000000000000000001111111
 11100110000000000001111111110000000000000000111000000000000111111
 11110110000000000000000000000000000000000111111111110000000011111
 11111110000000000000000000000000000000001111111111111100000001111
 11111110000010000000000000000001100000000111011111111110000001111
 11111111000111110000000000000111110000000000111111111110110000111
 11111110001111111100010000000001111100000111111111111111110000111
 11111110001111111111111110000000111111100000000111111111111000111
 11111111001111111111111111111000000111111111111111111111111100011
 11111111101111111111111111111110000111111111111111111111111001111
 11111111111111111111111111111110001111111111111111111111100111111
 11111111111111111111111111111111001111111111111111111111001111111
 11111111111111111111111111111111100111111111111111111111111111111
 11111111111111111111111111111111110111111111111111111111111111111
 
 
 */
